package com.echo.code.thread.mode.phantom;

/**
 * TestCase Created by baiyap on 2018/10/6.
 */
public class TestCase {

  public static void main(String[] args) {
    LRUCache<String, Reference> cache = new LRUCache<>(5, key -> new Reference());
    cache.get("Alex");
    cache.get("Jack");
    cache.get("Gavin");
    cache.get("Dillon");
    cache.get("Leo");
    // 上面的数据在缓存中的新旧程度为Leo>Dillon>Gavin>Jack>Alex

    cache.get("Jenny"); // Alex将会被踢出
    System.out.println(cache.toString());
  }

}
